local skill = fk.CreateSkill{
  name = "execute_skill",
}

Fk:loadTranslationTable{
  ["execute_skill"] = "一刀斩",
  ["#execute_skill"] = "选择一名其他角色，对其造成%arg点伤害",
}

skill:addEffect("cardskill", {
  prompt = function (self, player)
    return "#execute_skill:::" .. player.hp
  end,
  target_num = 1,
  can_use = function (self, player, card, extra_data)
    if player:prohibitUse(card) or player.hp < 1 then return end
    return table.find(Fk:currentRoom().alive_players, function(p)
        return self:targetFilter(player, p, {}, {}, card, extra_data)
      end)
  end,
  mod_target_filter = function(self, player, to_select, selected, card, extra_data)
    return to_select ~= player
  end,
  target_filter = function(self, player, to_select, selected, _, card, extra_data)
    if not Util.CardTargetFilter(self, player, to_select, selected, _, card, extra_data) then return end
    return self:modTargetFilter(player, to_select, selected, card, extra_data)
  end,
  on_effect = function(self, room, effect)
    if not effect.to.dead then
      room:damage({
        from = effect.from,
        to = effect.to,
        card = effect.card,
        damage = effect.from.hp,
        damageType = fk.NormalDamage,
        skillName = skill.name
      })
    end
  end,
})

return skill
